package robot.util;

import java.util.List;

import com.google.wave.api.Event;
import com.google.wave.api.EventType;

public class Util
{
	/**
	 * Checks whether a button was clicked 
	 * 
	 * 	 @return true If the user clicked on the button (@EventType.FORM_BUTTON_CLICKED)
	 */
	public static boolean isButtonClicked(List<Event> events, String buttonId)
	{
		for (Event event : events)
		{
			if (event.getType() == EventType.FORM_BUTTON_CLICKED && buttonId.equals(event.getButtonName()))
				return true;
		}
		return false;
	}

}
